// Code generated by smithy-go-codegen DO NOT EDIT.

package s3

import (
	
	awsmiddleware 
	
	s3cust 
	
	
	smithyhttp 
)

// Returns the website configuration for a bucket. To host website on Amazon S3,
// you can configure a bucket as website by adding a website configuration. For
// more information about hosting websites, see Hosting Websites on Amazon S3
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html). This GET
// action requires the S3:GetBucketWebsite permission. By default, only the bucket
// owner can read the bucket website configuration. However, bucket owners can
// allow other users to read the website configuration by writing a bucket policy
// granting them the S3:GetBucketWebsite permission. The following operations are
// related to DeleteBucketWebsite:
//
// * DeleteBucketWebsite
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketWebsite.html)
//
// *
// PutBucketWebsite
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html)
func ( *Client) ( context.Context,  *GetBucketWebsiteInput,  ...func(*Options)) (*GetBucketWebsiteOutput, error) {
	if  == nil {
		 = &GetBucketWebsiteInput{}
	}

	, ,  := .invokeOperation(, "GetBucketWebsite", , , .addOperationGetBucketWebsiteMiddlewares)
	if  != nil {
		return nil, 
	}

	 := .(*GetBucketWebsiteOutput)
	.ResultMetadata = 
	return , nil
}

type GetBucketWebsiteInput struct {

	// The bucket name for which to get the website configuration.
	//
	// This member is required.
	Bucket *string

	// The account ID of the expected bucket owner. If the bucket is owned by a
	// different account, the request fails with the HTTP status code 403 Forbidden
	// (access denied).
	ExpectedBucketOwner *string

	noSmithyDocumentSerde
}

type GetBucketWebsiteOutput struct {

	// The object key name of the website error document to use for 4XX class errors.
	ErrorDocument *types.ErrorDocument

	// The name of the index document for the website (for example index.html).
	IndexDocument *types.IndexDocument

	// Specifies the redirect behavior of all requests to a website endpoint of an
	// Amazon S3 bucket.
	RedirectAllRequestsTo *types.RedirectAllRequestsTo

	// Rules that define when a redirect is applied and the redirect behavior.
	RoutingRules []types.RoutingRule

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata

	noSmithyDocumentSerde
}

func ( *Client) ( *middleware.Stack,  Options) ( error) {
	 = .Serialize.Add(&awsRestxml_serializeOpGetBucketWebsite{}, middleware.After)
	if  != nil {
		return 
	}
	 = .Deserialize.Add(&awsRestxml_deserializeOpGetBucketWebsite{}, middleware.After)
	if  != nil {
		return 
	}
	if  = addSetLoggerMiddleware(, );  != nil {
		return 
	}
	if  = awsmiddleware.AddClientRequestIDMiddleware();  != nil {
		return 
	}
	if  = smithyhttp.AddComputeContentLengthMiddleware();  != nil {
		return 
	}
	if  = addResolveEndpointMiddleware(, );  != nil {
		return 
	}
	if  = v4.AddComputePayloadSHA256Middleware();  != nil {
		return 
	}
	if  = addRetryMiddlewares(, );  != nil {
		return 
	}
	if  = addHTTPSignerV4Middleware(, );  != nil {
		return 
	}
	if  = awsmiddleware.AddRawResponseToMetadata();  != nil {
		return 
	}
	if  = awsmiddleware.AddRecordResponseTiming();  != nil {
		return 
	}
	if  = addClientUserAgent();  != nil {
		return 
	}
	if  = smithyhttp.AddErrorCloseResponseBodyMiddleware();  != nil {
		return 
	}
	if  = smithyhttp.AddCloseResponseBodyMiddleware();  != nil {
		return 
	}
	if  = swapWithCustomHTTPSignerMiddleware(, );  != nil {
		return 
	}
	if  = addOpGetBucketWebsiteValidationMiddleware();  != nil {
		return 
	}
	if  = .Initialize.Add(newServiceMetadataMiddleware_opGetBucketWebsite(.Region), middleware.Before);  != nil {
		return 
	}
	if  = addMetadataRetrieverMiddleware();  != nil {
		return 
	}
	if  = addGetBucketWebsiteUpdateEndpoint(, );  != nil {
		return 
	}
	if  = addResponseErrorMiddleware();  != nil {
		return 
	}
	if  = v4.AddContentSHA256HeaderMiddleware();  != nil {
		return 
	}
	if  = disableAcceptEncodingGzip();  != nil {
		return 
	}
	if  = addRequestResponseLogging(, );  != nil {
		return 
	}
	return nil
}

func ( string) *awsmiddleware.RegisterServiceMetadata {
	return &awsmiddleware.RegisterServiceMetadata{
		Region:        ,
		ServiceID:     ServiceID,
		SigningName:   "s3",
		OperationName: "GetBucketWebsite",
	}
}

// getGetBucketWebsiteBucketMember returns a pointer to string denoting a provided
// bucket member valueand a boolean indicating if the input has a modeled bucket
// name,
func ( interface{}) (*string, bool) {
	 := .(*GetBucketWebsiteInput)
	if .Bucket == nil {
		return nil, false
	}
	return .Bucket, true
}
func ( *middleware.Stack,  Options) error {
	return s3cust.UpdateEndpoint(, s3cust.UpdateEndpointOptions{
		Accessor: s3cust.UpdateEndpointParameterAccessor{
			GetBucketFromInput: getGetBucketWebsiteBucketMember,
		},
		UsePathStyle:                   .UsePathStyle,
		UseAccelerate:                  .UseAccelerate,
		SupportsAccelerate:             true,
		TargetS3ObjectLambda:           false,
		EndpointResolver:               .EndpointResolver,
		EndpointResolverOptions:        .EndpointOptions,
		UseARNRegion:                   .UseARNRegion,
		DisableMultiRegionAccessPoints: .DisableMultiRegionAccessPoints,
	})
}